/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.tienda.control;

import cl.tienda.modelo.Producto;
import cl.tienda.modelo.Usuario;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Vector;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Sergio
 */
public class ServletInicioSesion extends HttpServlet {
    private Vector <Producto> productos;
    private Vector <Usuario> usuarios;
    
    public void inicializarUsuarios(){
        this.usuarios=new Vector<Usuario>();
        usuarios.add(new Usuario(1 , "vanessa", "perez", "user1", "1234", "cliente"));
        Usuario a = new Usuario(2, "richarr", "chavez", "user2", "1234", "vendedor");
        usuarios.add (a);
        }
    public void inicializarProductos(){
        this.productos=new Vector<Producto>();
        productos.add(new Producto(1, "Pendrive", 50, 123.12f));
        productos.add(new Producto(2,"teclado", 23, 200.45f));
        productos.add(new Producto(3,"pantalla", 3, 1000.45f));
    
    }
    
        
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doPost(request, response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
    
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
